#ifndef CONSTRAINEDTEXTINPUTDIALOG_H
#define CONSTRAINEDTEXTINPUTDIALOG_H

#include <QDialog>
#include <QRegExp>

namespace Ui {
    class ConstrainedTextInputDialog;
}

class ConstrainedTextInputDialog : public QDialog {
Q_OBJECT

public:
    explicit ConstrainedTextInputDialog(
            QWidget *parent,
            const QString &title,
            const QString &label,
            const QString &initialText = QString(),
            const QRegExp &constraint = QRegExp(".*"));
    ~ConstrainedTextInputDialog();
    QString textValue() const;

private:
    Ui::ConstrainedTextInputDialog *m_ui;
    bool m_valid;

private slots:
    void updateUi();
    void returnPressed();
};

#endif // CONSTRAINEDTEXTINPUTDIALOG_H
